-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix SSH configuration indentation in cloud-init template #14837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The sshd_config file was being written with incorrect indentation due to the indent filter having first=True, which added 6 spaces to the first line of the template. This caused SSH daemon to fail parsing the config file, preventing SSH connections on the configured port (4160). Changed indent(width=6, first=True) to indent(width=6, first=False) to ensure the SSH configuration is written without leading spaces on each line, allowing sshd to properly parse the configuration. Fixes SSH connection timeouts during DigitalOcean deployments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
Claude finished @dguido's task —— View job PR Code ReviewTodo List
Review SummaryVerdict: ✅ APPROVED - This is a critical bug fix that should be merged What This Change DoesThe PR fixes a subtle but critical bug in the cloud-init template at Before: {{ lookup('template', 'files/cloud-init/sshd_config') | indent(width=6, first=True) }}After: {{ lookup('template', 'files/cloud-init/sshd_config') | indent(width=6, first=False) }}Technical AnalysisRoot CauseWhen The leading whitespace on all lines made the configuration invalid, causing The FixWith Code Quality Assessment✅ Strengths
🎯 Impact AnalysisFiles Affected:
Scope:
Security Review✅ Security Assessment
Performance Considerations✅ Performance Impact
Test Coverage✅ Test AnalysisThe existing test suite at
The test suite appears comprehensive and should catch regressions. Potential Issues & Recommendations
|
Analysis: This PR Should Not Be MergedAfter thorough testing, I've determined that the proposed change ( Why
|
Summary
indent(width=6, first=True)toindent(width=6, first=False)in cloud-init templateProblem
The SSH configuration file (
/etc/ssh/sshd_config) was being written with 6 spaces of indentation on every line due to thefirst=Trueparameter in the Jinja2 indent filter. This made the configuration file invalid, causing the SSH daemon to fail during startup and preventing connections on the configured port (4160).Solution
Removed the
first=Trueparameter (equivalent tofirst=False) from the indent filter to ensure the SSH configuration is written with proper formatting that sshd can parse.Test Plan
/etc/ssh/sshd_configon the deployed server has correct formattingThis bug likely affects all cloud deployments that use cloud-init for initial configuration.
🤖 Generated with Claude Code